<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- .lazy 由实时触发 变为change触发  回车或失去焦点 -->
      <input type="text" v-model.lazy="msg" />
      <!-- .number 转换输入的number类型的字符串内容为number -->
      <input type="text" v-model.number="num" />
      <!-- 去除首位空格 -->
      <input v-model.trim="myage" />
      <div>{{msg}}</div>
      <div>{{num}}</div>
      <div>{{myage}}</div>
    </div>
    <script src="vue.js"></script>
    <script>
      var vm = new Vue({
        name: 'navcom', //标识每个组件的名字  非关键字 var function   保留字throw int   标签
        el: '#app',
        data() {
          return {
            msg: '',
            num: '0',
            myage: ''
          }
        },
        updated() {
          console.log(typeof this.num)
        },
        methods: {}
      })
    </script>
  </body>
</html>
